﻿using UnityEngine;
using System.Collections;

public class ValuableScript : GameLogic {

	// Use this for initialization
	void Start () {
	
	}

	void OnCollisionEnter2D(Collision2D coll) 
	{
		if (coll.transform.GetComponent<CatchControls> () != null) {
			try
			{
						GameObject.Find ("CatchingMiniGame").GetComponent<ValuableGameLogic> ().SendMessage ("Lose");
			}
			catch
			{
				GameObject.Find ("CatchingMiniGame(Clone)").GetComponent<ValuableGameLogic> ().SendMessage ("Lose");
			}
				}
		}
	// Update is called once per frame
	void Update () {
		if (this.transform.position.y < -6)
						Destroy (this.gameObject);

	}
}
